package com.landon.id.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.landon.id.model.entity.CosIdSegmentDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @author shishaopeng
 */
@Mapper
public interface CosIdSegmentMapper extends BaseMapper<CosIdSegmentDO> {

    /**
     * 自增增加号段
     *
     * @param id           号段id
     * @param segmentCount 号段数量
     * @return Boolean
     */
    @Update("update cos_id_segment set auto_increment = auto_increment + #{segmentCount} where id = #{id} ")
    Boolean updateCosIdSegmentAutoIncrement(@Param("id") Long id, @Param("segmentCount") Long segmentCount);
}
